package com.xszx.business.controller.web;

import com.xszx.server.dto.AjaxJson;
import com.xszx.server.service.CategoryService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController("webCategoryController")
@RequestMapping("/web/category")
public class CategoryController {

    private static final Logger LOG = LoggerFactory.getLogger(CategoryController.class);
    public static final String BUSINESS_NAME = "分类";

    @Resource
    private CategoryService categoryService;

    @ApiOperation(value = "查询全部分类",notes = "将一级分类和二级分类全部查询")
    @PostMapping("/getAllCategorys")
    public AjaxJson getAllCategorys(){
        return AjaxJson.success().put("categorys",categoryService.getAllCategorys());
    }

}
